<template>
	<view class="hxxx-main" @click="closeDemo" id='informationMode'>
		<view class="hxxx-data">
			<view class="hxxx-title">
				验证码
			</view>
			<view class="hxxx-item">
				<span style="margin-right: 15rpx;">核销ID:</span><input style="border:1px solid #333" type="text"
					v-model="yzmid" placeholder="验证码" />
			</view>
			<view class="hxxx-item" style="justify-content: center;">
				<span class="item-btn">取消</span>
				<span class="item-btn" @click="yesconfg">确认</span>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		lotteryrolloutmergerecordingAuditData
	} from '@/api/init/api.js'
	export default {
		props: {
			mdata: {
				type: Object,
				required: true,
				default: {},
			}

		},
		data() {
			return {
				content: {

				},
				yzmid: ''
			}
		},
		created() {
			this.content = this.mdata
			console.log(this.mdata);
		},
		methods: {
			closeDemo(e) {
				if (e.target.id == 'informationMode') {
					this.$emit('change', false);
				}

			},
			yesconfg() {
				let that = this
				let data = {
					rollOutUserId: this.content.rollOutUserId,
					uniqueCode: this.yzmid,
					id: this.content.id,
					status: 1,
				}
				lotteryrolloutmergerecordingAuditData(data).then(res => {
					console.log(res);
					if (res.code == 0) {
						uni.showToast({
							title: '核销成功',
							//将值设置为 success 或者直接不用写icon这个参数
							icon: 'success',
							//显示持续时间为 2秒
							duration: 2000
						})
						that.$emit('change', false);
					}
				})
				console.log(this.content, this.yzmid);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.hxxx-main {
		width: 100%;
		height: 100%;
		background-color: #0005;
		position: absolute;
		top: 0;
		right: 0;
		z-index: 2;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.hxxx-data {
		width: 80%;
		height: 20vh;
		background-color: #fff;
		display: flex;
		flex-direction: column;
		padding: 15rpx;
		box-sizing: border-box;

		.hxxx-title {
			font-size: 1.3rem;
		}

		.hxxx-item {
			margin: 22rpx 0;
			display: flex;
			align-items: center;

			.item-btn {
				width: 160rpx;
				height: 60rpx;
				background: linear-gradient(90deg, rgba(255, 93, 56, 1) 0%, rgba(252, 135, 109, 0.96) 100%);
				color: #fff;
				font-weight: bolder;
				border-radius: 15rpx;
				margin: 0 20rpx;
				display: flex;
				justify-content: center;
				align-items: center;
			}
		}
	}
</style>